<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
	<title>Hide and seek</title>
	<meta title="template local_template.html">
</head>

<body>
<div id="main_title">Hide and seek</div>
<div id="content">
<p>
The hidden_code plugin is intended to provide a tutorial writer the
capability of hiding code in a safe way for the user.  The idea behind this is
to be able to display only a small part of a listing (say for a game) on
which we want the learner to focus, and perhaps invite to modify, while
providing a much larger body of code to be executed.

</p>
<p>First test</p>
<pre title="hidden_code linenumbers">
a = 2

!hidden_code_begin
a = 3
hidden_code_end!

print a

!hidden_code_begin
print 42
hidden_code_end!
</pre>

<p>Second test: pygame</p>
<pre title="hidden_code_external">
!hidden_code_begin
import sys, pygame
pygame.init()
clock = pygame.time.Clock()
size = width, height = 320, 240
speed = [3, 3]
black = 0, 0, 0
screen = pygame.display.set_mode(size)
surf = pygame.Surface((50, 50))
ball = pygame.draw.circle(surf, (255,0,0), (25, 25), 25, 0)
ballrect = surf.get_rect()
hidden_code_end!

while True:
    for event in pygame.event.get():
       if event.type == pygame.QUIT: sys.exit()
    ballrect = ballrect.move(speed)
    if ballrect.left &lt; 0 or ballrect.right &gt; width:
        speed[0] = -speed[0]
    if ballrect.top &lt; 0 or ballrect.bottom &gt; height:
        speed[1] = -speed[1]
    clock.tick(30)
    screen.fill(black)
    screen.blit(surf, ballrect)
    pygame.display.flip()
</pre>


</div>
</body>
</html>
